//
//  YQAboutUsHeadView.m
//  NewRetail
//
//  Created by yuqin on 2019/6/30.
//  Copyright © 2019 yuqin. All rights reserved.
//

#import "YQAboutUsHeadView.h"

@implementation YQAboutUsHeadView

- (void)setupContentView {
    [self addSubview:self.headImg];
    [self addSubview:self.versionLab];
    [self addSubview:self.describeLab];
    
    [self.headImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(FIT(35));
        make.size.mas_equalTo(CGSizeMake(FIT(64), FIT(64)));
        make.centerX.mas_equalTo(self.mas_centerX);
    }];
    
    [self.versionLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.headImg.mas_bottom).mas_equalTo(FIT(15));
        make.left.mas_equalTo(kMargin_left);
        make.size.mas_equalTo(CGSizeMake(ScreenWidth-2*kMargin_left, 20));
    }];
    CGFloat label_H = [UILabel getLabelHeightWithText:self.describeLab.text width:ScreenWidth-FIT(80) font:kTheTitleFont];
    NSLog(@"label_H = %2.f",label_H);
    [self.describeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(FIT(40));
        make.top.equalTo(self.versionLab.mas_bottom).mas_equalTo(FIT(15));
        make.size.mas_equalTo(CGSizeMake(ScreenWidth-FIT(80), label_H+FIT(20)));
    }];
    
    self.headViewHeight = FIT(160)+label_H;
    
}

- (UIImageView *)headImg {
    if (!_headImg) {
        _headImg = [YQViewFactory imageViewWithImage:YQ_IMAGE(@"")];
        _headImg.backgroundColor = MainRedTextColor;
    }
    return _headImg;
}

- (UILabel *)versionLab {
    if (!_versionLab) {
        _versionLab = [YQViewFactory labelWithTextColor:MainBlueColor textAlignment:NSTextAlignmentCenter fontSize:kTheTitleFont userBold:NO];
        //获取系统当前版本
        _versionLab.text = [NSString stringWithFormat:@"版本号 %@",app_Version];
    }
    return _versionLab;
}

- (UILabel *)describeLab {
    if (!_describeLab) {
        _describeLab = [YQViewFactory labelWithTextColor:UIColorFromRGB(0x808080) textAlignment:NSTextAlignmentLeft fontSize:kTheTitleFont userBold:NO];
        _describeLab.numberOfLines = 0;
        _describeLab.text = @"WDC Wallet是一款移动APP A卡客服谁都水交易网站于2016年7月上线运营主要服交易网交易网站于2016年7月上线运营主要服交易网";
    }
    return _describeLab;
}


@end
